import React, { Component } from 'react'
import { Switch, Route, NavLink,Redirect } from 'react-router-dom'
import  News  from "./secd/news";
import  Video from "./secd/video";

class List extends Component {

    render() {
        return (
            <div className="col-md-8">
                <ul>
                    <li > <NavLink to='/list/news' activeClassName='red'  >News</NavLink> </li>
                    <li > <NavLink to='/list/video' activeClassName='red'  >Video</NavLink> </li>
                </ul>
                <Switch>
                    {/* 需要去掉 exact 的精确匹配 */}

                    <Route path='/list/news'   component={News}></Route>
                    <Route path='/list/video'   component={Video}></Route>
                    <Redirect to='/list/news'></Redirect>
                </Switch>
            </div>
        )
    }
}
export default List